export enum TopicStatus {
    // 标题字体
    RED = 0,
    BLUE = 1,
    GREEN = 2,
    ORANGE = 3,
    SILVER = 4,
    BOLD = 5,
    ITALIC = 6,
    LINE_THROUGH = 7,
    OPEN = 8, // "开放", "#909090", "", "回复不受注册时间限制"
    LIVE = 16, // "直播", "#909090", "这是一条直播", ""
    ALL_LOCK = 17, // "全锁", "#C58080", "合集内无法编辑/回复/发布子主题", "锁定合集的全部主题"
    REVERSED = 18, // "新回复在前", "#C58080", "新回复在前", "新回复在前"
    DOWN = 19, // "下沉1", "#A0B4F0", "合集子主题不上浮", "合集子主题不上浮"
    ALL_ANONYMOUS = 21, // "全匿", "#C58080", "回复这个主题会自动匿名", "回复自动匿名"
    COLLAPSE = 24, // "折叠", "#A0B4F0", "", "合集/版面镜像不显示附加子主题"
    ALL_HIDDEN = 25, // "全隐", "#C58080", "回复这个主题会自动隐藏", "回复自动隐藏"
    SHOW_IMAGE = 26, // "带图", "#909090", "", "在主题列表中显示图片(样式2)"
    SHOW_REPLY = 27, // "内容", "#909090", "", "主题列表中显示最近回复"
    REVERSED_1 = 28,
    REVERSED_2 = 29,
    REPLY_ONCE = 30, // "单帖", "#909090", "每个用户只能回复一次(2000回复以内)", "每个用户只能回复一次(2000回复以内)"
}


export const parseTopicStatus = (bit: number): TopicStatus[] => {
    const status: TopicStatus[] = []

    for (let i = 0; i < 32; i++) {
        if ((bit & Math.pow(2, i)) !== 0) {
            status.push(i as TopicStatus)
        }
    }

    return status
}